home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Time Bonus
- -- Original Carnage Contest Weapon
- -- Script by DC, August 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.timebonus={}
-
- -- Load & Prepare Ressources
- cc.timebonus.gfx_wpn=loadgfx("weapons/timebonus.png") -- Weapon Image
- setmidhandle(cc.timebonus.gfx_wpn)
- cc.timebonus.sfx_heal=loadsfx("timebonus.ogg")
-
- --------------------------------------------------------------------------------
- -- Weapon: Time Bonus
- --------------------------------------------------------------------------------
-
- cc.timebonus.id=addweapon("cc.timebonus","Time Bonus",cc.timebonus.gfx_wpn,1,2) -- Add Weapon (1 use, first in round 2)
-
- function cc.timebonus.draw() -- Draw
- -- Do nothing!
- end
-
- function cc.timebonus.attack(attack) -- Attack
- if (weapon_shots<=0) then
- if (attack==1) then
- -- Use weapon and allow to use another one afterwards (1)
- useweapon(1)
- weapon_shots=weapon_shots+1
- -- Time Bonus
- changeturntime(20)
- -- Effect
- playsound(cc.timebonus.sfx_heal)
- x=getplayerx(0)
- y=getplayery(0)+3
- particle(p_muzzle,x,y)
- particlesize(1,1)
- particlecolor(255,255,0)
- particlealpha(1.0)
- particlefadealpha(0.01)
- particle(p_muzzle,x,y)
- particlesize(1,2)
- particlecolor(255,255,0)
- particlealpha(1.0)
- particlefadealpha(0.02)
- particlerotation(0)
- for j=1,15,1 do
- particle(p_flare,x-10.0+math.random()*20.0,y+math.random()*10.0)
- particlesize(3.0,3.0)
- particlecolor(255,255,0)
- particlespeed(0,math.random(2,15)*-0.1)
- particlefadealpha(0.01)
- end
- end
- end
- end